//
//  GHSYNview.m
//  Diary
//
//  Created by lanou3g on 15/11/17.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "GHSYNview.h"

@implementation GHSYNview

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addView];
    }
    return self;
}

- (void)addView
{
    UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
    bgV.backgroundColor = [UIColor whiteColor];
    bgV.center = CGPointMake(kScreenWidth / 2, kScreenHeight / 2);
    bgV.layer.cornerRadius = 0.5;
    [self addSubview:bgV];
    
    // first
    UIView *firstV = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 30, 30)];
    firstV.backgroundColor = [UIColor redColor];
    firstV.layer.cornerRadius = 15;
    [bgV addSubview:firstV];
    
    // two
    UIView *twoV = [[UIView alloc] initWithFrame:CGRectMake(50, 10, 30, 30)];
    twoV.backgroundColor = [UIColor redColor];
    twoV.layer.cornerRadius = 15;
    [bgV addSubview:twoV];
    
    // three
    UIView *threeV = [[UIView alloc] initWithFrame:CGRectMake(50, 10, 30, 30)];
    threeV.backgroundColor = [UIColor redColor];
    threeV.layer.cornerRadius = 15;
    [bgV addSubview:threeV];
}

@end
